package woaini.wind.bot.gitlab;

import com.alibaba.fastjson2.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import woaini.wind.bot.gitlab.service.GitLabWebHookHandler;

@RestController
@RequestMapping("/gitlab/")
@Slf4j
public class GitLabWebHook {

  @RequestMapping("/hook")
  public void hook(@RequestBody JSONObject event){
    log.info("gitLabHook:{}",event.toJSONString());
    GitLabWebHookHandler.handler(event);
  }
}
